<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
    #imgid{
    	position:absolute;
    	top:0px;
    	overflow:hidden;
    	display:block;
    }

	</style>
</head>
<body>
	<img src="1.jpg" id="imgid">
</body>
<script type="text/javascript">
imgobj=document.getElementById('imgid');
screenHeight=document.documentElement.clientHeight;
imgHeight=128;
diffHeight=screenHeight-imgHeight;
ys=0;
yv=10;

setInterval(function(){
ys+=yv;
if(ys>=diffHeight){
	ys=diffHeight;
	yv=-yv;
}
if(ys<0){
	yv=-yv;
	
}
imgobj.style.top=ys+'px';



},100)

	




</script>
</html>